var i;
Object.defineProperty(exports, "__esModule", {
  value: true
});
var ResKeeper = require("AA_ResKeeper");
var NodePoolMag = require("AA_NodePoolMag");
var BuffMag = require("AA_BuffMag");
var UI_MosterLogic = require("AA_UI_MosterLogic");
var _decorator = cc._decorator;
var _ccclass = _decorator.ccclass;
_decorator.property;

var _def_UI_DuWu = function (e) {
  function _creator() {
    var t = null !== e && e.apply(this, arguments) || this;
    t.nowbuffdata = null;
    t.dushanplayer = null;
    t.nowmoster = [];
    t.offtime = 0;
    t.leijitime = 0;
    return t;
  }
  __extends(_creator, e);
  _creator.prototype.initInfo = function (e, t) {
    this.nowbuffdata = e;
    this.dushanplayer = t;
  };
  _creator.prototype.onCollisionEnter = function (e) {
    var t = e.node.getComponent(UI_MosterLogic.default);
    this.nowmoster.push(t);
  };
  _creator.prototype.onCollisionExit = function (e) {
    var t = e.node.getComponent(UI_MosterLogic.default);
    var o = this.nowmoster.findIndex(function (e) {
      return t.node.uuid == e.node.uuid;
    });
    this.nowmoster.splice(o, 1);
  };
  _creator.prototype.onUpdate = function (e) {
    var t = this;
    this.offtime += e;
    if (this.offtime >= 1) {
      this.leijitime += 1;
      this.nowmoster.forEach(function (e) {
        var o = BuffMag.BuffMgr.playAttackJiaCheng(t.dushanplayer, t.dushanplayer.sgattack, 1);
        e.fujiaAttack(o, 3, t.dushanplayer);
      });
      this.offtime = 0;
    }
    if (this.leijitime >= this.nowbuffdata.bufftime) {
      this.nowmoster = [];
      NodePoolMag.NodePoolMag.instance.recycleNode("duwu", this.node);
    }
  };
  return __decorate([_ccclass], _creator);
}(ResKeeper.default);
exports.default = _def_UI_DuWu;